package contraGame;

import java.awt.Color;

import quadtree.DoublePoint;
import utility.ContraEnemy;
import utility.ContraMan;
import utility.ContraPlatform;
import utility.ContraReticle;
import main.GameTree;
import main.TAdapter;

public class Level2 extends Level1 {
	
	public GameTree modifyGameTree() {
		gameTree = new GameTree();
		bob = new ContraMan(30, 550);
		bob.setGameTree(gameTree);
		bob.createContraMansGun();
		bob.setLevelEnd(2000);
		gameTree.insertSprite(new DoublePoint(30,550), bob);
		contraReticle = new ContraReticle();
		gameTree.insertSprite(new DoublePoint(30,550), contraReticle);
		gameTree.insertSprite(new DoublePoint(75, 555), 
				new ContraPlatform(75, 555, 100, 25, Color.DARK_GRAY));
		gameTree.insertSprite(new DoublePoint(225, 545), 
				new ContraPlatform(225, 545, 100, 25, Color.DARK_GRAY));
		gameTree.insertSprite(new DoublePoint(550, 225), 
				new ContraEnemy(550, 225, 25, 25, Color.PINK, gameTree));
		gameTree.insertSprite(new DoublePoint(150, 350), 
				new ContraEnemy(150, 350, 25, 25, Color.PINK, gameTree));
		gameTree.insertSprite(new DoublePoint(550, 225), 
				new ContraEnemy(550, 225, 25, 25, Color.PINK, gameTree));
		gameTree.insertSprite(new DoublePoint(850, 350), 
				new ContraEnemy(850, 350, 25, 25, Color.PINK, gameTree));
		gameTree.insertSprite(new DoublePoint(1150, 225), 
				new ContraEnemy(1150, 225, 25, 25, Color.PINK, gameTree));
		gameTree.insertSprite(new DoublePoint(1550, 350), 
				new ContraEnemy(1550, 350, 25, 25, Color.PINK, gameTree));
		//startEngine();
		return gameTree;
	}

	public GameTree handleInput(TAdapter userInput){
		try{
			gameHandleInput(userInput);
		}
		catch(Exception e){
			e.printStackTrace();
		}
		return gameTree;
	}
}
